home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 1
/
Atari Mega Archive - Volume 1.iso
/
apps
/
astronmy
/
strchart.arc
/
patch.arc
/
starchrt.dif
< prev
next >
Wrap
Text File
|
1989-03-23
|
6KB
|
189 lines
*** ../starchart/starchart.c Mon Sep 19 09:12:20 1988
--- starchrt.c Mon Sep 26 23:50:39 1988
***************
*** 58,72 ****
--- 58,87 ----
![11] the -g flag sets a mag limit for star proper names, else use codes
*/
+ #ifdef ST_MWC /* Mark Williams C for the Atari ST */
+ #define SYSV /* MWC is almost SYSV compatible */
+ #endif /* ST_MWC */
+
#include <stdio.h>
#include <math.h>
#ifndef SYSV
#include <strings.h>
#else
+ #define index strchr
+ #ifndef SYSVR3 /* System V release 3 doesn't have this header file */
+ #ifndef ST_MWC
#include <string.h>
+ #else /* ST_MWC */
+ char *strchr();
+ #endif /* ST_MWC */
+ #endif /* SYSVR3 */
#endif
#include <ctype.h>
+ #ifndef ST_MWC
#include "starchart.h"
+ #else /* ST_MWC */
+ #include "starchrt.h"
+ #endif /* ST_MWC */
/*
* default datasets are local, unless defined in Makefile
***************
*** 122,127 ****
--- 137,149 ----
int annodetail, objdetail; /* flags to control output */
int annoswitch, objswitch; /* switches as seen on command line */
float olat, olon; /* save areas for track clipping */
+ #ifdef ST_MWC
+ #ifdef INTERACTIVE
+ extern int oldrez; /* Used to see if we've initialized the screen. */
+ int exit_and_save = FALSE; /* Don't wait for keypress when done, save file */
+ char picturefile[15]; /* into "picturefile" (def = star.pi1) and exit */
+ #endif /* INTERACTIVE */
+ #endif /* ST_MWC */
/* the code */
***************
*** 253,258 ****
--- 275,297 ----
case 'b': bigflag = TRUE; break;
case 'a': annoswitch = TRUE; break;
case 'o': objswitch = TRUE; break;
+ #ifdef ST_MWC
+ #ifdef INTERACTIVE
+ /* Exit immediately, saving the picture in a DEGAS or
+ NeoChrome file (Chosen by .pi1 or .neo extender */
+ case 'x': exit_and_save = TRUE;
+ if (((j+1) < argc) && (argv[j+1][0] != '-'))
+ strcpy(picturefile, argv[++j]);
+ else
+ strcpy(picturefile, "star.pi1");
+ break;
+ #else /* !INTERACTIVE */
+ /* Help for the GEM Desktop, which cannot redirect. */
+ case 'x': if (((j+1) < argc) && (argv[j+1][0] != '-'))
+ freopen(argv[++j], "wb", stdout);
+ break;
+ #endif /* INTERACTIVE */
+ #endif /* ST_MWC */
default: die("unknown switch - %s", argv[j]); break;
}
if (j == argc) die("trailing command line flag - %s", argv[j-1]);
***************
*** 373,379 ****
--- 412,426 ----
if (!title) title = "LEGEND";
rastr(ras, chart->racen);
declstr(dls, chart->dlcen);
+ #ifdef ST_MWC
+ #ifdef INTERACTIVE /* This bleeds over into the thumbnail, so trim it */
+ sprintf(outstr, "(%s,%s)", ras, dls, chart->maglim);
+ #else /* !INTERACTIVE */
sprintf(outstr, "(%s,%s lim: %2.1f)", ras, dls, chart->maglim);
+ #endif /* INTERACTIVE */
+ #else /* !ST_MWC */
+ sprintf(outstr, "(%s,%s lim: %2.1f)", ras, dls, chart->maglim);
+ #endif /* ST_MWC */
/*
* there are reports that large point sizes (eg "16", below) cause characters
* to overlap on some (pic?) output devices. To fix, set values to "10".
***************
*** 417,422 ****
--- 464,481 ----
pvecsize(10); pvecsyms( 95,75,"double"); pdrawStar( 65,75, 2, 'D', NULL);
pvecsize(10); pvecsyms(260,75,"variable"); pdrawStar(230,75, 2, 'V', NULL);
+ #ifdef ST_MWC
+ #ifdef INTERACTIVE /* Adjust the legend so symbols don't overlap labels */
+ pvecsize(10); pvecsyms( 95,50,"planet"); pdrawPlan( 75,50, 1, 'S', NULL);
+ pdrawPlan( 55,50, 1, 's', NULL);
+ pdrawPlan( 35,50, 1, 'V', NULL);
+ pvecsize(10); pvecsyms(260,50,"galaxy"); pdrawGalx(240,50, 1, 'E', NULL);
+ pdrawGalx(215,50, 1, 'S', NULL);
+ pvecsize(10); pvecsyms( 95,25,"nebula"); pdrawNebu( 75,25, 1, 'D', NULL);
+ pdrawNebu( 45,25, 1, 'P', NULL);
+ pvecsize(10); pvecsyms(260,25,"cluster"); pdrawClus(240,25, 1, 'O', NULL);
+ pdrawClus(215,25, 1, 'G', NULL);
+ #else /* !INTERACTIVE */
pvecsize(10); pvecsyms( 95,50,"planet"); pdrawPlan( 65,50, 1, 'S', NULL);
pvecsize(10); pvecsyms(260,50,"galaxy"); pdrawGalx(230,50, 1, 'E', NULL);
pdrawGalx(205,50, 1, 'S', NULL);
***************
*** 424,429 ****
--- 483,490 ----
pdrawNebu( 40,25, 1, 'P', NULL);
pvecsize(10); pvecsyms(260,25,"cluster"); pdrawClus(230,25, 1, 'O', NULL);
pdrawClus(205,25, 1, 'G', NULL);
+ #endif /* INTERACTIVE */
+ #endif /* ST_MWC */
}
chartbanner(chart)
***************
*** 495,501 ****
if (sbuf[11] != 0)
code[0] = sbuf[15];
subcode[0] = sbuf[16];
! color [0] = '\0'; strcpy (color, " "); /* set unknowns to blanks */
label [0] = '\0';
name [0] = '\0'; strncat (name, &sbuf[17], strlen (&sbuf [17]) - 1);
}
--- 556,562 ----
if (sbuf[11] != 0)
code[0] = sbuf[15];
subcode[0] = sbuf[16];
! strcpy(color, " "); /* set unknowns to blanks */
label [0] = '\0';
name [0] = '\0'; strncat (name, &sbuf[17], strlen (&sbuf [17]) - 1);
}
***************
*** 554,566 ****
--- 615,635 ----
/*
* extract color, label and name
*/
+ #ifdef ST_MWC
+ len = strlen(sbuf);
+ if (len > 16)
+ #endif /* ST_MWC */
strncat (color, &sbuf[16], 2);
+ #ifdef ST_MWC
+ if (len > 18)
+ #endif /* ST_MWC */
strncat (label, &sbuf[18], strlen (&sbuf [18]) - 1);
if ((len = strlen (label)) > 5)
{
strncat (name, &label[5], len - 5);
label [5] = '\0';
}
+ break;
}
}
return(0);
***************
*** 896,901 ****
--- 965,971 ----
return (new -= b);
}
+ #ifndef INTERACTIVE
die(a,b)
char *a, *b;
{
***************
*** 904,909 ****
--- 974,980 ----
fprintf(stderr,"\n");
exit(1);
}
+ #endif /* !INTERACTIVE */
#define LINELEN 80
static char legend[LINELEN];